package com.yiren.backstage.currency.entity;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;
import org.greenrobot.greendao.annotation.Property;
import org.greenrobot.greendao.annotation.ToOne;

import org.greenrobot.greendao.DaoException;
import com.yiren.backstage.db.dao.DaoSession;
import com.yiren.backstage.db.dao.JudgeEntityDao;

/**
 * Time:2021/10/29 9:05
 * Author:xiaozan
 * Description:项目评判 实体类
 */
@Entity(nameInDb = "judge", createInDb = false)
public class JudgeEntity {

    @Id
    private String id;

    /**所属父级评判，如果是0或者空 为父级*/
    private String parentId;
    @ToOne(joinProperty = "parentId")
    private JudgeEntity parentJudgeEntity;

    /**评判描述*/
    private String describe;

     /**评判选择类型：只针对父级ID为0时 对应 JudgeChooseTypeEnum*/
    private String chooseType;

    /**数据类型：区分低、高精度数据 对应 DataTypeEnum*/
    private String dataType;

   /* //评判执行次数 当前这个值放在此表存在问题：当不符合条件时才反复执行
    private int executeCount;
*/
    /**状态*/
    private  String status;

    /**评判是否启用*/
    private String isEnable;

    /** Used to resolve relations */
    @Generated(hash = 2040040024)
    private transient DaoSession daoSession;

    /** Used for active entity operations. */
    @Generated(hash = 2086800649)
    private transient JudgeEntityDao myDao;

    @Generated(hash = 80873256)
    public JudgeEntity(String id, String parentId, String describe,
            String chooseType, String dataType, String status, String isEnable) {
        this.id = id;
        this.parentId = parentId;
        this.describe = describe;
        this.chooseType = chooseType;
        this.dataType = dataType;
        this.status = status;
        this.isEnable = isEnable;
    }

    @Generated(hash = 2032884750)
    public JudgeEntity() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getParentId() {
        return this.parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }

    public String getDescribe() {
        return this.describe;
    }

    public void setDescribe(String describe) {
        this.describe = describe;
    }

    public String getChooseType() {
        return this.chooseType;
    }

    public void setChooseType(String chooseType) {
        this.chooseType = chooseType;
    }

    public String getDataType() {
        return this.dataType;
    }

    public void setDataType(String dataType) {
        this.dataType = dataType;
    }

    public String getStatus() {
        return this.status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getIsEnable() {
        return this.isEnable;
    }

    public void setIsEnable(String isEnable) {
        this.isEnable = isEnable;
    }

    @Generated(hash = 968472500)
    private transient String parentJudgeEntity__resolvedKey;

    /** To-one relationship, resolved on first access. */
    @Generated(hash = 1954091673)
    public JudgeEntity getParentJudgeEntity() {
        String __key = this.parentId;
        if (parentJudgeEntity__resolvedKey == null
                || parentJudgeEntity__resolvedKey != __key) {
            final DaoSession daoSession = this.daoSession;
            if (daoSession == null) {
                throw new DaoException("Entity is detached from DAO context");
            }
            JudgeEntityDao targetDao = daoSession.getJudgeEntityDao();
            JudgeEntity parentJudgeEntityNew = targetDao.load(__key);
            synchronized (this) {
                parentJudgeEntity = parentJudgeEntityNew;
                parentJudgeEntity__resolvedKey = __key;
            }
        }
        return parentJudgeEntity;
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1129818800)
    public void setParentJudgeEntity(JudgeEntity parentJudgeEntity) {
        synchronized (this) {
            this.parentJudgeEntity = parentJudgeEntity;
            parentId = parentJudgeEntity == null ? null : parentJudgeEntity.getId();
            parentJudgeEntity__resolvedKey = parentId;
        }
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#delete(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 128553479)
    public void delete() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.delete(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#refresh(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 1942392019)
    public void refresh() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.refresh(this);
    }

    /**
     * Convenient call for {@link org.greenrobot.greendao.AbstractDao#update(Object)}.
     * Entity must attached to an entity context.
     */
    @Generated(hash = 713229351)
    public void update() {
        if (myDao == null) {
            throw new DaoException("Entity is detached from DAO context");
        }
        myDao.update(this);
    }

    /** called by internal mechanisms, do not call yourself. */
    @Generated(hash = 1082816141)
    public void __setDaoSession(DaoSession daoSession) {
        this.daoSession = daoSession;
        myDao = daoSession != null ? daoSession.getJudgeEntityDao() : null;
    }
}
